<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../lib/layui-v2.6.8/layui/css/layui.css"/>
		<link rel="stylesheet" type="text/css" href="../lib/cropper/cropper.css"/>
		<link rel="stylesheet" type="text/css" href="user_avatar.css"/>
	</head>
	<body>
		<!-- 卡片区域 -->
		<div class="layui-card">
		  <div class="layui-card-header">更换头像</div>
		  <div class="layui-card-body">
		    <!-- 第一行的图片裁剪和预览区域 -->
		        <div class="row1">
		          <!-- 图片裁剪区域 -->
		          <div class="cropper-box">
		            <!-- 这个 img 标签很重要，将来会把它初始化为裁剪区域 -->
		           <img src="../images/sample.jpg" id="img">
		          </div>
		          <!-- 图片的预览区域 -->
		          <div class="preview-box">
		            <div>
		              <!-- 宽高为 100px 的预览区域 -->
		              <div class="img-preview w100"></div>
		              <p class="size">100 x 100</p>
		            </div>
		            <div>
		              <!-- 宽高为 50px 的预览区域 -->
		              <div class="img-preview w50"></div>
		              <p class="size">50 x 50</p>
		            </div>
		          </div>
		        </div>
		      
		        <!-- 第二行的按钮区域 -->
		        <div class="row2">
					<!-- 通过accept属性，可以指定允许用户选择什么类型的文件 -->
					<input type="file" id="file" accept="image/png,image/jpeg"/>
		          <button type="button" class="layui-btn" id="btnChooseImage">上传</button>
		          <button type="button" class="layui-btn layui-btn-danger" id="btnUpload">确定</button>
		        </div>
		  </div>
		</div>
		<script src="../lib/layui-v2.6.8/layui/layui.js" type="text/javascript" charset="utf-8"></script>
		<script src="../lib/jQuery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../lib/cropper/Cropper.js" type="text/javascript" charset="utf-8"></script>
		<script src="../lib/cropper/jquery-cropper.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/API.js" type="text/javascript" charset="utf-8"></script>
		<script src="./user_avatar.js" type="text/javascript" charset="utf-8"></script>
	</body>
</html>
